<template>
  <div>
    <glue/>
    <el-drawer
      title="设计器"
      :visible.sync="ShowDesigner"
      :direction="direction"
      :before-close="handleClose"
    >
      <user-designer :designer-name="designerName" ref="Designer"/>
    </el-drawer>
  </div>
</template>
<script>
import Glue from './Temp/Glue.vue'
import EventBus from '@/libs/EventBus'
import AppParams from '@/utils/Enum'

export default {
  name: 'UserPage',
  components: { Glue },
  data() {
    return {
      ShowDesigner: false,
      direction: 'rtl',
      designerName: ''
    }
  },
  methods: {
    handleClose() {
      this.ShowDesigner = false
    },
    SetName(res) {
      this.ShowDesigner = true
      this.$nextTick(() => {
        this.designerName = res.name
      })
    }
  },
  mounted() {
    EventBus.$on(AppParams.DESIGNER.OK_NG, this.SetName)
  }
}
</script>

<style scoped lang="less">

</style>
